package com.ruoyi.order.service.impl;

import java.util.ArrayList;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.StoreProductOrderHandleMapper;
import com.ruoyi.order.domain.StoreProductOrderHandle;
import com.ruoyi.order.service.IStoreProductOrderHandleService;

/**
 * 订单操作记录Service业务层处理
 *
 * @author ruoyi
 * @date 2021-11-25
 */
@Service
public class StoreProductOrderHandleServiceImpl implements IStoreProductOrderHandleService
{
    @Autowired
    private StoreProductOrderHandleMapper storeProductOrderHandleMapper;

    /**
     * 查询订单操作记录
     *
     * @param id 订单操作记录主键
     * @return 订单操作记录
     */
    @Override
    public StoreProductOrderHandle selectStoreProductOrderHandleById(Long id)
    {
        return storeProductOrderHandleMapper.selectStoreProductOrderHandleById(id);
    }

    /**
     * 查询订单操作记录列表
     *
     * @param storeProductOrderHandle 订单操作记录
     * @return 订单操作记录
     */
    @Override
    public List<StoreProductOrderHandle> selectStoreProductOrderHandleList(StoreProductOrderHandle storeProductOrderHandle)
    {
        return storeProductOrderHandleMapper.selectStoreProductOrderHandleList(storeProductOrderHandle);
    }

    /**
     * 新增订单操作记录
     *
     * @param storeProductOrderHandle 订单操作记录
     * @return 结果
     */
    @Override
    public int insertStoreProductOrderHandle(StoreProductOrderHandle storeProductOrderHandle)
    {
        storeProductOrderHandle.setCreateTime(DateUtils.getNowDate());
        return storeProductOrderHandleMapper.insertStoreProductOrderHandle(storeProductOrderHandle);
    }

    /**
     * 修改订单操作记录
     *
     * @param storeProductOrderHandle 订单操作记录
     * @return 结果
     */
    @Override
    public int updateStoreProductOrderHandle(StoreProductOrderHandle storeProductOrderHandle)
    {
        storeProductOrderHandle.setUpdateTime(DateUtils.getNowDate());
        return storeProductOrderHandleMapper.updateStoreProductOrderHandle(storeProductOrderHandle);
    }

    /**
     * 批量删除订单操作记录
     *
     * @param ids 需要删除的订单操作记录主键
     * @return 结果
     */
    @Override
    public int deleteStoreProductOrderHandleByIds(Long[] ids)
    {
        return storeProductOrderHandleMapper.deleteStoreProductOrderHandleByIds(ids);
    }


    /**
     * 批量逻辑删除订单操作记录
     *
     * @param ids 需要删除的订单操作记录主键
     * @return 结果
     */
    @Override
    public int logicDeleteStoreProductOrderHandle(Long[] ids,String delType,Long delUser)
    {
        return storeProductOrderHandleMapper.logicDeleteStoreProductOrderHandle(ids,delType,delUser);
    }

    /**
     * 删除订单操作记录信息
     *
     * @param id 订单操作记录主键
     * @return 结果
     */
    @Override
    public int deleteStoreProductOrderHandleById(Long id)
    {
        return storeProductOrderHandleMapper.deleteStoreProductOrderHandleById(id);
    }

    @Override
    public void insrAll(ArrayList<StoreProductOrderHandle> list) {
        storeProductOrderHandleMapper.insrAll(list);
    }
}
